import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import './assets/css/base.css'

import axios from 'axios'
axios.defaults.baseURL = ''

// 请求拦截
axios.interceptors.request.use(config => {
  // 每次请求都会带上token
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config
})
// 全局挂载axios
Vue.prototype.$http = axios

Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
